# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python2-webargs
pkgname=('python2-webargs' 'python-webargs')
_pkgname=webargs
pkgver=8.7.0
pkgrel=1
pkgdesc='A friendly library for parsing and validating HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.'
arch=('any')
url='https://pypi.org/project/webargs/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b98cfe70cd90164778d96229d4abd22a746f77899b7709e7ba90cb22597ff1712e9abda391d6787ae51bc8c0ac8b87bedf11e60c548a9e60fab3049a8b6a157c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-webargs() {
  depends=('python2' 'python2-marshmallow' 'python2-simplejson')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-webargs() {
  depends=('python' 'python-marshmallow')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

